Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum


  

PreviousPrevious NextNext

RE: Agent to @SetField Not Working
~Umberto Nongeroson 20.Jan.04 04:37 PM a Web browser
Domino Designer 6.0.1 iSeries


What other people said, and in addition It's unclear what you intend the agent to do. Here's your formula:

@If(@Contains(@DbColumn("";"":@Subset(@DbName; -1);"StoryCoWeather";2); "CANCELLED");@SetField("Yes";"NewsTitle");SELECT @All

Here are my comments about it:

(1) If you want to search in the current database, you can just use "" in place of "":@Subset(@DbName; -1);

(2) If you want to make a change to certain documents and not others, use the SELECT statement to decide which documents to change, thus:

SELECT @Contains(@DbColumn("";"":@Subset(@DbName; -1);"StoryCoWeather";2); "CANCELLED");
FIELD NewsTitle := "Yes"

This still doesn't make any sense, but it's in a more conventional and efficient form.

(3) Since your if condition doesn't refer to any information in the current document, it's going to give the same result for each document. If any document in the view shows CANCELLED, NewsTitle is set to "Yes" in all documents. I suspect that you really meant to set the NewsTitle field in only those documents where column 2 shows CANCELLED.

(4) If you want to set a certain field always, but want to use the @If to decide what to set it to, then you can set the field to the result of @If:

SELECT @All;
FIELD NewsTitle := @If(@Contains(SomeOtherField; "CANCELLED"); "No"; "Yes")

(5) Since you're designing for Notes 6, you don't have to use @SetField; you can put a regular FIELD assignment inside an @If.

@If(@Contains(SomeOtherField; "CANCELLED"); FIELD Erase := "Yes"; FIELD NewsTitle := "Yes")

(6) Don't use @Contains unless you're searching for a subset of a string. = (or @IsMember) is more efficient if you want to match the whole string. = also works with lists if you're trying to match one of the values exactly.




Agent to @SetField Not Working (~Naomi Ekponepl... 19.Jan.04)
. . RE: Agent to @SetField Not Working (~Hal Zenrekonyl... 19.Jan.04)
. . RE: Agent to @SetField Not Working (~Mario Lopkiste... 19.Jan.04)
. . RE: Agent to @SetField Not Working (~Mark Nimnuplop... 20.Jan.04)
. . RE: Agent to @SetField Not Working (~Bill Frokimari... 20.Jan.04)


Document Options






  Document options
Print this pagePrint this page

Search this forum

Forum views and search


  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Category
Platform
Release
Advanced search

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS